import React, { Component } from 'react';
import Routerview from '../../router/routerView';
import { TabBar } from 'antd-mobile'
class Index extends Component {
  render() {
    const { routes } = this.props
    return (
      <div>
        {/* 底部 */}
        {/* 5.切换路由页面，实现导航栏图标高亮效果 */}
        <TabBar onChange={ (key) => this.props.history.push(key) }>
          <TabBar.Item key="/home/index" title={'首页'} >
          </TabBar.Item>
          <TabBar.Item key="/home/car" title={'购物车'} >
          </TabBar.Item>
          <TabBar.Item key="/home/my" title={'我的'} >
          </TabBar.Item>
        </TabBar>

        {/* 出口 */}
        <Routerview routes={routes}></Routerview>
      </div>
    );
  }
}

export default Index;
